﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/Management.master" AutoEventWireup="true"
    CodeFile="CompanyInfo.aspx.cs" Inherits="Management_CompanyInfo" %>

<%@ Import Namespace="Avatar.Company" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="Avatar.Common" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table>
        <tr>
            <td>
                <div class="Dialog">
                    <div class="Title">
                        用户资料管理
                    </div>
                    <div class="Content">
                        用户名:<asp:TextBox ID="txt_KeyWord" runat="server" Width="200px"></asp:TextBox> 
                        <asp:DropDownList ID="ddl_ServiceType" runat="server" 
                            DataSourceID="SqlDataSource1" DataTextField="TypeName" DataValueField="ID">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:AvatarConnectionString %>" 
                            SelectCommand="SELECT [ID], [TypeName] FROM [CompanyServiceType]">
                        </asp:SqlDataSource>
                        <asp:Button ID="btn_Search" runat="server" Text="搜索" CssClass="Button" OnClick="btn_Search_Click" />
                        <asp:ListView ID="ListView1" runat="server">
                            <ItemTemplate>
                                <tr style="">
                                    <td>
                                        <%# Eval("User") %>
                                        <%# Eval("ServiceID").ToString()=="3"?"<br>":""%>
                                        <%# Eval("ServiceID").ToString() == "3" ? "[到期日期:"+ExpirationDateManager.GetExpirationDate(Eval("User").ToString())+"]": ""%>
                                    </td>
                                    <td>
                                        <%# Eval("CompanyName") != null ?Eval("CompanyName").ToString() : "未填写"%>
                                    </td>
                                    <td>
                                        <%# Eval("RegisterTime")!=null?Eval("RegisterTime"):"--"%>
                                    </td>
                                    <td>
                                        <%# "[<a href='Company_Information.aspx?Company=" + Eval("User") + "'>基本信息</a>]"%>
                                        <%# "[<a href='Company_Contact.aspx?Company=" + Eval("User") + "'>联系方式</a>]"%>
                                        <asp:Button ID="btn_Delete" runat="server" Text="删除" OnClick="btn_Delete_Click" CommandArgument='<%# Eval("User") %>' />
                                        <asp:Button ID="btn_PasswordReset" runat="server" Text="密码重置" OnClick="btn_PasswordReset" CommandArgument='<%# Eval("User") %>'/>
                                        <%# Eval("CompanyName").ToString() != "未填写" ? "[<a target='_blank' href='../CompanyJobList.aspx?Company=" + Eval("CompanyName") + "'>职位信息</a>]" : ""%>
                                        <asp:Button ID="btn_Vip" runat="server" Text="按条" 
                                            CommandArgument='<%# Eval("User") %>' Visible='<%# Eval("ServiceID").ToString()=="1"?true:false %>' onclick="btn_Vip_Click" />
                                        <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" 
                                            ConfirmText="确定要设定此用户为'按条计费用户'吗？" TargetControlID="btn_Vip">
                                        </ajaxToolkit:ConfirmButtonExtender>
                                        <asp:Button ID="btn_Monthly" runat="server" Text="包月" 
                                            CommandArgument='<%# Eval("User") %>' Visible='<%# Eval("ServiceID").ToString()=="1"||Eval("ServiceID").ToString()=="2"?true:false %>' onclick="btn_Monthly_Click" />
                                        <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender3" runat="server" 
                                            ConfirmText="确定要设定此用户为'包月计费用户'吗？" TargetControlID="btn_Monthly">
                                        </ajaxToolkit:ConfirmButtonExtender>
                                        <%# Eval("ServiceID").ToString()=="2"?"[<a href='CompanyRecharge.aspx?key="+ Eval("User")+"'>充值</a>]":""%>
                                        <asp:Button ID="btn_ExpirationDate" runat="server" Text="到期时间" Visible='<%# Eval("ServiceID").ToString()=="3"?true:false %>' OnClick="btn_ExpirationDate_Click"
                                            CommandArgument='<%# Eval("User") %>' />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <EmptyDataTemplate>
                                <table border="0">
                                    <tr style="">
                                        <th id="Th1" class="th" runat="server">
                                            用户名
                                        </th>
                                        <th id="Th2" class="th" runat="server">
                                            企业名称
                                        </th>
                                        <th id="Th3" class="th" runat="server">
                                            注册时间
                                        </th>
                                        <th id="Th4" class="th" runat="server">
                                            操作
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div style="padding: 10px;">
                                                未找到任何数据</div>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <LayoutTemplate>
                                <table runat="server">
                                    <tr runat="server">
                                        <td runat="server">
                                            <table id="itemPlaceholderContainer" runat="server" border="0" style="">
                                                <tr runat="server" style="">
                                                    <th class="th" runat="server">
                                                        用户名
                                                    </th>
                                                    <th class="th" runat="server">
                                                        企业名称
                                                    </th>
                                                    <th class="th" runat="server">
                                                        注册时间
                                                    </th>
                                                    <th class="th" runat="server">
                                                        操作
                                                    </th>
                                                </tr>
                                                <tr id="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr runat="server">
                                        <td runat="server" style="">
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                        </asp:ListView>
                        <asp:Label ID="lbl_Current" runat="server" />/<asp:Label ID="lbl_Total" runat="server" />
                        <asp:Button ID="btn_Up" runat="server" Text="上页" OnClick="btn_Up_Click" />
                        <asp:Button ID="btn_Down" runat="server" Text="下页" OnClick="btn_Down_Click" />
                        <asp:TextBox ID="txt_PageNumber" runat="server" Width="30px"></asp:TextBox>
                        <asp:Button ID="btn_Goto" runat="server" Text="转到" OnClick="btn_Goto_Click" />
                    </div>
                </div>
                <asp:Panel ID="panel_Date" runat="server">
                    <div class="Dialog" style="width: 300px;">
                        <div class="Title">
                            <table width="100%">
                                <tr>
                                    <td>
                                        选择到期日期
                                    </td>
                                    <td style="text-align: right;">
                                        <asp:LinkButton ID="btn_Cancel" runat="server">X</asp:LinkButton>&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="Content">
                            到期日期:<asp:TextBox ID="txt_ExDate" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_ExDate"
                                Display="Dynamic" ErrorMessage="*" ValidationGroup="Date"></asp:RequiredFieldValidator>
                            &nbsp;<asp:HiddenField ID="txt_Company" runat="server" />
                            <asp:Button ID="btn_Set" runat="server" Text="保存" CssClass="Button" OnClick="btn_Set_Click"
                                ValidationGroup="Date" />
                            <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="保存后无法还原，确定保存吗？"
                                TargetControlID="btn_Set">
                            </ajaxToolkit:ConfirmButtonExtender>
                            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txt_ExDate">
                            </ajaxToolkit:CalendarExtender>
                        </div>
                    </div>
                </asp:Panel>
                <asp:Label ID="lbl_Error" runat="server" ForeColor="Red" EnableViewState="false" />
            </td>
        </tr>
    </table>
</asp:Content>
